
/*
*	create by  jack ,20210705
*	
*	描述 ：
*		  该文件提供了一套设备调用的接口，屏蔽具体实现细节,以达到应用程序可以在不同的平台上联合调试。
*		  open 返回该设备枚举类别。无设备实现时，返回负数.
*   修改记录：[内容][作者][时间]
*	
*/


#ifndef _SANJI_OS_FILE_OPT_H_
#define _SANJI_OS_FILE_OPT_H_

#include "define_comm.h"

#ifdef __cplusplus
extern "C"{
#endif
struct file_operations;
struct file
{
	sj_void	*private_data;
	sj_loff_t f_pos;
	struct file_operations *f_op;
};

struct file_operations {
	sj_int32 (*open) (struct file *);
	sj_int32 (*release) (struct file *);
	sj_int32 (*flush) (struct file *);
	sj_uint32 (*read) (struct file *, sj_char  *, sj_size_t, sj_loff_t *);
	sj_uint32 (*write) (struct file *, const sj_char  *, sj_size_t, sj_loff_t *);
	sj_loff_t (*llseek) (struct file *, sj_loff_t, sj_int32);
	sj_int32 (*poll) (struct file *);
	sj_long (*unlocked_ioctl) (struct file *, sj_uint32, sj_uint32);
	sj_long (*compat_ioctl) (struct file *, sj_uint32, sj_uint32);
};


#ifdef __cplusplus
}
#endif
#endif